-
Notifications
You must be signed in to change notification settings - Fork 87
Tooling > TypeScript Support #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビュー 👀 してコメント 💬 しました。
確認お願いします! 🙏
src/guide/typescript-support.md
Outdated
|
||
For developing Vue applications with TypeScript, we strongly recommend using [Visual Studio Code](https://code.visualstudio.com/), which provides great out-of-the-box support for TypeScript. If you are using [single-file components](./single-file-components.html) (SFCs), get the awesome [Vetur extension](https://github.com/vuejs/vetur), which provides TypeScript inference inside SFCs and many other great features. | ||
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[シングルファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
シングルファイルコンポーネント
は 単一ファイルコンポーネント
でお願いします。 現時点で日本語公式ドキュメントはそのように訳して統一しているので。
あと、awesome
の訳は(多分typo?) 素晴らしい
にしておきました。
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[シングルファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。 | |
TypeScript による Vue アプリケーションの開発のために、すぐに利用できる TypeScript サポートを提供している [Visual Studio Code](https://code.visualstudio.com/) を強く推奨します。[単一ファイルコンポーネント](./single-file-components.html) (SFCs) を使用している場合、SFC 内部での TypeScript の推論やその他の優れた機能を提供している、素晴らしい [Vetur エクステンション](https://github.com/vuejs/vetur) を入手してください。 |
src/guide/typescript-support.md
Outdated
} | ||
}) | ||
``` | ||
|
||
If you have a complex type or interface, you can cast it using [type assertion](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions): | ||
複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
技術用語は、カタカナ日本語で訳す場合は、以下のように原文の技術用語の載せてください! 🙏
(載せておくことで技術用語が翻訳されて意味が分からない人のためにも、原文を残して置くことによって理解できるようにしておくためです。)
複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます: | |
複雑な型や推論の場合、[タイプアサーション (type assertions)](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます: |
|
||
## Using with Composition API | ||
## コンポジション API とともに使用する |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@potato4d
翻訳方針として v2 のときのガイドラインに従う形なんですが、Compostion API
という技術用語、カタカナ日本語でとりあえず、訳す方向にします?
個人的にはカタカナ日本語に訳すのは、あまり意味がない(読み方が分かる程度)のと、訳してかえってわかりにくくなるとという過去の経験から、今後としては技術用語は、原文のままとしておきたいです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
個人的にはカタカナ日本語に訳すのは、あまり意味がない(読み方が分かる程度)のと、訳してかえってわかりにくくなるとという過去の経験から、今後としては技術用語は、原文のままとしておきたいです。
ここで、途中から、このような形にしてしまうと、これまでの翻訳形式と一貫性がなくなってしまうので、引き続き訳すという方向で行きたいと思います。
src/guide/typescript-support.md
Outdated
@@ -140,9 +140,9 @@ const Component = defineComponent({ | |||
}) | |||
``` | |||
|
|||
### Annotating Props | |||
### プロパティにアノテーションをつける |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここは、プロパティ
に訳さず、 Props
のままとしてください。 🙏
Props
としておくことで、Vue コンポーネントの props というのが読み手の分かりやすいので。
### プロパティにアノテーションをつける | |
### Props にアノテーションをつける |
src/guide/typescript-support.md
Outdated
const result = props.message.split('') // correct, 'message' is typed as a string | ||
const filtered = props.message.filter(p => p.value) // an error will be thrown: Property 'filter' does not exist on type 'string' | ||
const result = props.message.split('') // 正しいです, 'message' は文字列 (string) として型づけされます | ||
const filtered = props.message.filter(p => p.value) // エラーが起こります: 'filter' プロパティは文字列 (string) 型には存在しません。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Property 'filter' does not exist on type 'string'
は TypeScript のコンパイラのエラーだと思うので、もしそうならば、訳さずそのままにしておきたいです。
src/guide/typescript-support.md
Outdated
@@ -206,25 +208,28 @@ const Component = defineComponent({ | |||
const year = ref(2020) | |||
|
|||
const result = year.value.split('') // => Property 'split' does not exist on type 'number' | |||
const result = year.value.split('') // => 'split' プロパティは 'number' 型に存在しません |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここの、Property 'split' does not exist on type 'number'
も同じく、TypeScript のコンパイラのエラーだと思うので、もしそうならば、訳さずそのままにしておきたいです。
src/guide/typescript-support.md
Outdated
const doubleCount = computed(() => count.value * 2) | ||
|
||
const result = doubleCount.value.split('') // => Property 'split' does not exist on type 'number' | ||
const result = doubleCount.value.split('') // => 'split' プロパティは 'number' 型に存在しません。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Property 'split' does not exist on type 'number'
も同じく、TypeScript のコンパイラのエラーだと思うので、もしそうならば、訳さずそのままにしておきたいです。
src/guide/typescript-support.md
Outdated
@@ -258,10 +263,10 @@ export default defineComponent({ | |||
setup() { | |||
let count = ref(0) | |||
|
|||
// read-only | |||
// リードオンリー |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
訳すならば、以下のような感じですね。
// リードオンリー | |
// 読み取り専用 |
100321d
to
ab84ef5
Compare
Deploy preview for vuejs-v3-ja-doc-preview ready! Built with commit ab84ef5 https://deploy-preview-53--vuejs-v3-ja-doc-preview.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
レビューありがとうございます!
ご指摘の部分は、「Composition API」の部分を除いて修正されたと思います。
@@ -86,7 +86,7 @@ const Component = defineComponent({ | |||
}) | |||
``` | |||
|
|||
複雑な型や推論の場合、[タイプアサーション](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます: | |||
複雑な型や推論の場合、[タイプアサーション (type assertion)](https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions) を使用してキャストすることができます: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちら、原文の通り「type assertion」(単数形)を併記しました。
@@ -190,7 +190,7 @@ const Component = defineComponent({ | |||
|
|||
setup(props) { | |||
const result = props.message.split('') // 正しいです, 'message' は文字列 (string) として型づけされます | |||
const filtered = props.message.filter(p => p.value) // エラーが起こります: 'filter' プロパティは文字列 (string) 型には存在しません。 | |||
const filtered = props.message.filter(p => p.value) // エラーが起こります: Property 'filter' does not exist on type 'string' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちら、TypeScriptのエラーメッセージのようですので、原文に戻しました。
src/guide/typescript-support.md
Outdated
@@ -208,7 +208,6 @@ const Component = defineComponent({ | |||
const year = ref(2020) | |||
|
|||
const result = year.value.split('') // => Property 'split' does not exist on type 'number' | |||
const result = year.value.split('') // => 'split' プロパティは 'number' 型に存在しません |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちら、TypeScriptのエラーメッセージのようですので、原文に戻しました。
また、翻訳の際に文を複製したものが残っていたため、削除しました。
const doubleCount = computed(() => count.value * 2) | ||
|
||
const result = doubleCount.value.split('') // => 'split' プロパティは 'number' 型に存在しません。 | ||
const result = doubleCount.value.split('') // Property 'split' does not exist on type 'number' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちら、TypeScriptのエラーメッセージのようですので、原文に戻しました。
@nozomuikuta |
CIでエラー起きているが、これは |
翻訳ありがとうございました! |
resolves #41